<?php

/**
 * Tipska form base class.
 *
 * @package    dnevnik
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseTipskaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'skola_id'   => new sfWidgetFormPropelChoice(array('model' => 'Skola', 'add_empty' => false)),
      'predmet_id' => new sfWidgetFormPropelChoice(array('model' => 'Predmet', 'add_empty' => false)),
      'zakljucna'  => new sfWidgetFormInputCheckbox(),
      'nivo'       => new sfWidgetFormInput(),
      'opis'       => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorPropelChoice(array('model' => 'Tipska', 'column' => 'id', 'required' => false)),
      'skola_id'   => new sfValidatorPropelChoice(array('model' => 'Skola', 'column' => 'id')),
      'predmet_id' => new sfValidatorPropelChoice(array('model' => 'Predmet', 'column' => 'id')),
      'zakljucna'  => new sfValidatorBoolean(),
      'nivo'       => new sfValidatorInteger(),
      'opis'       => new sfValidatorString(array('max_length' => 200)),
    ));

    $this->widgetSchema->setNameFormat('tipska[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Tipska';
  }


}
